From: Jonas Ã…dahl Date: Sat, 7 Oct 2017 00:26:24 +0000 (-0400) Subject: layout: Unset primary and bottom monitor when headless X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~994^2^2~174 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=db43c45b12fbae462857e59dce6849c6aa965091;p=gnome-shell.git layout: Unset primary and bottom monitor when headless We were handling being initially headless by only setting the primary and bottom monitor if there was any primary monitor, then checking the primary monitor reference before making calls assuming there was any monitors. What we didn't do was unset the primary and bottom monitor when going headless, meaning that temporarly disconnecting a monitor while having windows open caused an assert to be triggered due to various code paths taking the path assuming there are valid monitors. Unsetting both the primary and bottom monitor when going headless avoids the code paths in the same way as they were avoided when starting headless. https://bugzilla.gnome.org/show_bug.cgi?id=788607 --- diff --git a/js/ui/layout.js b/js/ui/layout.js index 304c2a152..2f1894775 100644 --- a/js/ui/layout.js +++ b/js/ui/layout.js @@ -351,6 +351,9 @@ var LayoutManager = new Lang.Class({ this._loadBackground(); this._pendingLoadBackground = false; } + } else { + this.primaryMonitor = null; + this.bottomMonitor = null; } },